FROM docker.repo:5000/ppc64le/centos:7.2

#java install
RUN yum -y install java-1.7.0-openjdk.ppc64le

#elasticsearch
ENV FILESERVER 172.16.0.164
RUN echo "$FILESERVER fileserver" >> /etc/hosts
ADD http://$FILESERVER:8080/base_image/elasticsearch-2.3.1.tar.gz /tmp/pkg.tar.gz
RUN cd /tmp && \
#	wget https://download.elastic.co/elasticsearch/release/org/elasticsearch/distribution/tar/elasticsearch/2.3.1/elasticsearch-2.3.1.tar.gz -O pkg.tar.gz && \
	tar -zxf pkg.tar.gz && mv elasticsearch-* /opt/elasticsearch && \
	rm -rf /tmp/pkg.tar.gz

COPY elasticsearch.yml /opt/elasticsearch/config/elasticsearch.yml

VOLUME ["/var/lib/elasticsearch"]

EXPOSE 9200

ADD start.sh /start.sh

#WORKDIR /opt/elasticsearch/bin

CMD ["/start.sh"]
